package com.isoftstone.project.app.controller;

import com.isoftstone.common.utils.ExcelUtil;
import com.isoftstone.framework.controller.BaseController;
import com.isoftstone.framework.domain.Page;
import com.isoftstone.framework.domain.PageData;
import com.isoftstone.framework.domain.Tidings;
import com.isoftstone.project.system.domain.SysUser;
import com.isoftstone.project.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * systemController
 *
 * @author guoX
 * @date 2020-10-27
 */
@Controller
@RequestMapping("/app")
public class AppSysUserController extends BaseController {

    @Autowired
    private ISysUserService sysUserService;
    /**
     * 修改system
     */
    @RequestMapping(value = "/toEditSysUser",method= RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public Object toEditSysUser(String userId) {
        SysUser sysUser =sysUserService.getSysUserById(userId);
        return Tidings.success(sysUser);
    }

    /**
     * 修改保存system
     */
    @RequestMapping(value ="/updateSysUser",method= RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public Object updateSysUser(SysUser sysUser) {
        sysUserService.updateSysUser(sysUser);
        return Tidings.success();
    }

}
